package me.w70.hooks;

public class Tile {
	public int x;

	public int y;

	public Tile(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public void setX(int x) {
		this.x = x;
	}

	public void setY(int y) {
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	public boolean isValid() {
		return x != -1 && y != -1;
	}

	public int distanceTo(Tile target) {
		return (int) (Math.sqrt(Math.pow(target.x - x, 2)
				+ Math.pow(target.y - y, 2)));
	}

	boolean equals(Tile t) {
		return t.x == x && t.y == y;
	}

	public String toString() {
		return "(" + x + "," + y + ")";
	}

	public Tile copy() {
		return this;
	}
}
